package com.wmh.baseservice.user.mapper;

import com.wmh.baseservice.user.pojo.UsInfo;
import com.wmh.baseservice.common.mybatisplus.methods.CommonMapper;
import com.wmh.baseservice.user.pojo.vo.UsInfoRespVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author mmx generator
 * @since 2021-07-23
 */
public interface UsInfoMapper extends CommonMapper<UsInfo> {

    List<Long> promoteCommission(@Param("id") Long id);

    /**
     * 根据用户id查询头像url和昵称
     * @param usId 用户id
     * @return 返回用户头像url和昵称
     */
    UsInfoRespVO getAvatarAndNickByUsId(Long usId);

    @Select("SELECT balance FROM us_info WHERE id = #{usId}")
    BigDecimal getBalanceById(Long usId);
}
